]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
quickSettings: Allow setting accessible names for quick toggle menu buttons
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Tue, 5 Aug 2025 12:44:55 +0000 (14:44 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 14 Aug 2025 09:17:44 +0000 (09:17 +0000)
This allows to override the menu button's label.
This API will be used in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3828>

js/ui/quickSettings.js

index 921537463816ce83d3f6c304dc4ac8c976a2c23b..051294848cbf32c680f27635638e0c4ec422b827 100644 (file)
@@ -158,6 +158,10 @@ export const QuickMenuToggle = GObject.registerClass({
             'menu-enabled', null, null,
             GObject.ParamFlags.READWRITE,
             true),
+        'menu-button-accessible-name': GObject.ParamSpec.string(
+            'menu-button-accessible-name', null, null,
+            GObject.ParamFlags.READWRITE,
+            _('Open menu')),
     },
 }, class QuickMenuToggle extends QuickSettingsItem {
     _init(params) {
@@ -182,7 +186,6 @@ export const QuickMenuToggle = GObject.registerClass({
         this._menuButton = new St.Button({
             style_class: 'quick-toggle-menu-button icon-button',
             child: new St.Icon({icon_name: 'go-next-symbolic'}),
-            accessible_name: _('Open menu'),
             can_focus: true,
             x_expand: false,
             y_expand: true,
@@ -216,6 +219,9 @@ export const QuickMenuToggle = GObject.registerClass({
         this.bind_property('menu-enabled',
             this._menuButton, 'visible',
             GObject.BindingFlags.SYNC_CREATE);
+        this.bind_property('menu-button-accessible-name',
+            this._menuButton, 'accessible-name',
+            GObject.BindingFlags.SYNC_CREATE);
         this.bind_property('reactive',
             this._menuButton, 'reactive',
             GObject.BindingFlags.SYNC_CREATE);